#ifdef ONLINE_JUDGE
    #include<stdio.h>
    #define INPUT stdin
    int main(){
#else
    #include "header.h"
    #define INPUT fptIn
    int acm_00579() {
        printf("--ACM 579 begin here--\n");
        FILE *fptIn = fopen("Resource/acm_00579.txt", "r");
        if (fptIn == NULL)//Distinguish the input file is load success.
        {
            printf("File acm_00579.txt load fail.\n");
            printf("Program will exit.\n");
            return EXIT_FAILURE;
        }
#endif

    float hh = 12, mm = 12, ang;
    while (!feof(INPUT)) {
        fscanf(INPUT,"%f:%f", &hh, &mm);
        ang = (mm * 6) - (hh * 60 + mm) / 2;
        if (ang < 0) {
            ang = 0 - ang;
        }
        if (ang > 180) {
            ang = 360 - ang;
        }
        if (hh == 0 && mm == 0) {
            break;
        }
        printf("%.3f\n", ang);
    }
    #ifndef ONLINE_JUDGE
        printf("--ACM 579 end here--\n");
        fclose(INPUT);
    #endif
    return 0;
}

/*
   #    Problem                              Verdict    Language   Run Time       Submission Date 
8007846 579 ClockHands                      Accepted     ANSI C     0.040      2010-05-31 10:53:56 
 */
